<?php
error_reporting(0);
if (!$id = intval($_GET['id'])) exit();
define('MINI_RUN', true);
require '../admin/core/MysqlPDO.class.php';
$pdo = new MysqlPDO();
$pageId = 'page'.$_GET['id'];	//Cookie Key
if (empty($_COOKIE[$pageId])){	
	$pdo->changeSQL('UPDATE Mini_Page SET Click=Click+1 WHERE PageId=? limit 1', array($id));
	setcookie($pageId, 1, time()+3600*12);
}
$clickArray = $pdo->selectSQL('SELECT Click FROM Mini_Page WHERE PageId=? limit 1', array($id));
echo 'document.write('.($clickArray[0] ? $clickArray[0]['click'] : 1).');';
?>